#!/bin/bash

count=0
total=$(wc -l < "C:\Users\lyc\Desktop\spb\demands_to_process.txt")

while IFS= read -r demand_id; do
  count=$((count+1))
  echo "[$count/$total] Processing: $demand_id"
  curl -X POST "http://localhost:8080/api/demands/$demand_id/regenerate-summary" \
    -H "Content-Type: application/json" \
    -s -o /dev/null -w "HTTP %{http_code}\n"
  sleep 2
done < "C:\Users\lyc\Desktop\spb\demands_to_process.txt"

echo "Done!"
